<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%-- 用途说明：分页栏显示生成工具(用于所有需要分页的页面，协助生成分页工具栏)  --%>

<!-- 请求分页地址及请求条件带&不带countPerPage参数 -->
<c:set var="url" value="${param.url }" />

<div class="m-page m-page-sr m-page-sm m-page-rt m-page-c1"  >
    <a href="${param.url}">首页</a>
    <c:choose>
        <c:when test="${pager.pageNumber>1 }">
            <a href="${param.url}?pageNumber=${pager.pageNumber-1}">上一页</a>
        </c:when>
        <c:otherwise>
            <a href="${param.url}">上一页</a>
        </c:otherwise>
    </c:choose>
    <c:choose>
        <c:when test="${pager.pageNumber+1>pager.pageCount }">
            <a href="${param.url}?&pageNumber=${pager.pageCount}">下一页</a>
        </c:when>
        <c:otherwise>
            <a href="${param.url}?&pageNumber=${pager.pageNumber+1}">下一页</a>
        </c:otherwise>
    </c:choose>
    <a href="${param.url}?&pageNumber=${pager.pageCount}">末页</a>
    <a>${pager.pageNumber }/${pager.pageCount }页
        共${pager.totalCount }条记录</a>
</div>